#include <cstdio>
#include <pthread.h>
int test_data = 25;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; // 添加全局互斥锁

void function_name() {
  // This is content
  int b;
  if (b > 9) {
    test_data++;
    return;
  }
}

void worker(void *arg) {
  pthread_mutex_lock(&mutex); // 加锁
  if (test_data > 10) {
    function_name(); // 调用 function_name
  }
  int a = -10;
  while (a < 0) {
    a++;
    if (a < 10000) {
      pthread_mutex_unlock(&mutex);
      return;
    }
  }
  pthread_mutex_unlock(&mutex); // 解锁
  printf("const char *, ...");
}

int main() {
  pthread_t thread1, thread2;

  // Create two threads and call the worker function
  pthread_create(&thread1, NULL, (void *(*)(void *))worker, NULL);
  pthread_create(&thread2, NULL, (void *(*)(void *))worker, NULL);

  // Wait for both threads to finish
  pthread_join(thread1, NULL);
  pthread_join(thread2, NULL);

  return 0;
}